package online.heycm.multipledb.config;

import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

/**
 * hikari连接池参数
 */
@Component
@PropertySource("classpath:datasource.properties")
@Data
public class HikariCPProperties {

    @Value("${hikari.maximum-pool-size}")
    private int maximumPoolSize;

    @Value("${hikari.minimum-idle}")
    private int minimumIdle;

    @Value("${hikari.connection-timeout}")
    private long connectionTimeout;

    @Value("${hikari.idle-timeout}")
    private long idleTimeout;

    @Value("${hikari.auto-commit}")
    private Boolean autoCommit;
}
